/**
 * Created by Amaris on 2016/12/6.
 */

var express = require('express');
var router = express.Router();
var surveyingCtrl = require('../../controller/controller.surveying.js');

router.get('/getSurveyingInfo', function (req, res, next) {
    surveyingCtrl.getInfo(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});

router.post('/createSurveying', function (req, res, next) {
    surveyingCtrl.create(req.body, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});


router.post('/updateSurveying', function (req, res, next) {
    surveyingCtrl.update(req.body, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});

router.get('/getListByTeamId',function(req,res,next){
    surveyingCtrl.getListByTeamId(req.query,function(err,result){
        if (err) throw err;
        res.send(result);
    });
});

router.get('/getSurveyingList',function(req,res,next){
    surveyingCtrl.getList(req.query,function(err,result){
        if (err) throw err;
        res.send(result);
    });
});


router.get('/getSurveyingListBySeller',function(req,res,next){
    surveyingCtrl.getListBySeller(req.query,function(err,result){
        if (err) throw err;
        res.send(result);
    });
});



module.exports = router;
